package red.ouo.distributedtools.redis.lock.core;

import org.springframework.data.redis.core.RedisTemplate;
import red.ouo.distributedtools.redis.message.config.RedisMessageConfig;
import red.ouo.distributedtools.redis.message.core.RedisMessageCore;

public class RedisLockCore {
    RedisTemplate redisTemplate;

    public RedisLockCore(RedisTemplate redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    public static RedisLockCore.Builder connect(RedisTemplate redisTemplate, RedisMessageConfig config) {
        return (new RedisLockCore(redisTemplate).new Builder());
    }

    public class Builder {
        public Options options;
        public RedisLockCore.Options options() {
            return options = new RedisLockCore.Options(RedisLockCore.this);
        }
    }

    /**
     * 消息队列 可选配置
     *
     */
    public class Options {
        RedisLockCore redisLockCore;

        public Options(RedisLockCore redisLockCore) {
            this.redisLockCore = redisLockCore;
        }

        public RedisLockCore build() {
            return redisLockCore;
        }
    }
}
